/**
 * 
 */
package com.autonavi.car.si.FileStore.jdbc;

import java.util.Properties;

/**
 * 
 * @COMMENT:
 * @author KUCHENG.LIAO@AUTONAVI.COM
 * @DATE May 12, 2014
 * 
 */
public final class JDBCConfigUtil {

	private static Properties pop;

	private static volatile boolean init = false;

	private static void init() {
		try {
			if (init) {
				return;
			}
			synchronized (JDBCConfigUtil.class) {
				if (null == pop) {
					Properties p = new Properties();
					p.load(JDBCConfigUtil.class.getResource("/jdbc.properties").openStream());
					pop = p;
					init = true;
				}
			}
		} catch (Exception e) {
			throw new RuntimeException(e);
		}
	}

	/**
	 * 获取资源文件数据
	 * 
	 * @param key
	 * @return
	 */
	public static String get(String key) {
		init();
		return pop.getProperty(key);
	}
}
